This nonprovisional application claims priority under 35 U.S.C. xc2xa7119(a) on Patent Application No. 2001-375737 and 2001-377259 filed in JAPAN on Dec. 10, 2001 and Dec. 11, 2001, which is herein incorporated by reference.
1. Field of the Invention
The present invention relates to a distance measuring apparatus, and particularly to a distance measuring apparatus of, for example, a camera using a passive AF sensor.
2. Description of the Related Art
A distance measuring apparatus of a camera using a passive AF sensor forms images of a distance measurement object on a pair of left and right line sensors, for example, and obtains left and right sensor images (AF data). A pair of window ranges for obtaining a pair of AF data for use in correlation value calculation, of AF data obtained from the pair of left and right line sensors, are determined, and the pair of AF data for use in correlation value calculation are sequentially obtained, with the pair of window ranges being shifted in opposite directions in a pair of predetermined sensor areas (employed sensors). Alternatively, a pair of AF data for use in correlation value calculation are sequentially obtained, with one window range being fixed and the other window range being shifted. The correlation level of the thus obtained pair of AF data is determined, and the distance from the distance measurement object is calculated according to the shift amount of the pair of window ranges providing the highest correlation level (in which left and right sensor images are consistent with each other) (refer to Japanese Patent Application Publication Nos. 8-285580 and 11-23957, and Japanese Patent No. 3099603).
A shift amount of the pair of window ranges providing the minimum value of correlation values determined for the shift amounts of the pair of window ranges is generally considered as the shift amount of the pair of window ranges providing the highest correlation level. There are cases where a plurality of minimum values exist, and in these cases, the shift amount of the pair of window ranges providing the smallest minimum value is considered as the shift amount of the pair of window ranges providing the highest correlation level. Furthermore, for some methods of calculating correlation values, the maximum correlation value may correspond to the highest correlation level, but the following description is based on the assumption that the minimum correlation value corresponds to the highest correlation level.
There are cases where a plurality of minimum values exist, and in these cases, the shift amount of the pair of window ranges providing the smallest minimum value is determined to be the shift amount of the pair of window ranges of the highest correlation. However, in the case where the difference (hereinafter referred to as difference of minimum values) is small between the shift amount of the pair of window ranges with the smallest minimum value and the shift amount of the pair of window ranges with the second minimum value that is the second smallest minimum value, erroneous distance measurement may occur if the shift amount of the pair of window ranges with the smallest minimum value is determined to be the shift amount of the pair of window ranges of the highest correlation, and therefore it is preferably determined that distance measurement is impossible. Furthermore, determination on reliability of distance measurement is described in, for example, Japanese Patent Application Publication No. 2000-193879.
However, there are cases where it should be determined distance measurement is possible even if the difference between the smallest minimum value and the second minimum value is somewhat small, and where it should be determined that distance measurement is impossible even if the difference of the minimum values is somewhat large; and hence, it is not appropriate to determine whether distance measurement is possible or impossible according to whether the difference of the minimum values is smaller than a fixed threshold or not.
For the former aspect, for example, AF data in the employed sensor has low contrast. In this case, the correlation values calculated by the correlation value calculation are generally small, and therefore the difference of the minimum values is small. However, distance measurement is possible unless the difference of the minimum values is extremely small. For the latter aspect, on the other hand, AF data in the employed sensor has high contrast and changes periodically. Such AF data is obtained, for example, when a distance measurement object having a striped pattern is imaged. In this case, the correlation values calculated by correlation value calculation are changed periodically and are generally large, and therefore the difference of the minimum values is large. However, it should be determined that distance measurement is impossible because there is a high possibility that erroneous distance measurement occurs even if the difference of the minimum values is larger than the fixed threshold except that the difference of the minimum values is extremely large.
Therefore, when determining whether distance measurement is possible or impossible according to the difference of the minimum values, the possibility of erroneous distance measurement becomes higher as in the latter aspect if the threshold is set at a lower level, and the possibility that it is determined that distance measurement is impossible more than necessary becomes higher if the threshold is set at a higher as in the former aspect.
On the other hand, if the distance measurement object is located at a distance shorter than the closest distance where distance measurement is possible, no minimum value exists essentially, but there may be cases where a minimum value actually exists. In this case, the shift amount of the pair of window ranges providing the minimum value is determined to be the shift amount of the pair of window ranges providing the highest correlation level, and the distance from the distance measurement object is calculated according to the shift amount of the pair of window ranges, resulting in erroneous distance measurement.
Therefore, it is conventionally determined that distance measurement is impossible if the minimum value is larger than a predetermined reference value even when the minimum value exists, so that problems such that the distance from the distance measurement object is calculated with a minimum value not suitable as highest correlation are prevented.
In the conventional method, however, erroneous distance measurement where the distance measurement object is located at a distance shorter than the closest distance cannot be thoroughly prevented. For example, in the case where the distance measurement object is located at a distance shorter than the closest distance, and the contrast of the sensor image is low, there may exist an extremum smaller than the reference value for determining that distance measurement is impossible, and in this case distance measurement is carried out according to the shift amount of the pair of window ranges providing the extremum, and it is not determined that distance measurement is impossible.
In this way, in the case where the distance measurement object is located at a distance shorter than the closest distance, and a minimum value exists, a correlation value smaller than the minimum value exists on the side of the close distance. Moreover, a correlation value smaller than the minimum value may exist on the side of the infinite distance even if the distance measurement object is located in the range where distance measurement is possible. In this case, because it can be considered that something abnormal has occurred, erroneous distance measurement may occur as in the above-described case if the distance from the distance measurement object is calculated according to the shift amount of the pair of window ranges providing the minimum value.
The present invention has been devised in view of the above situations, and the object thereof is to provide a distance measuring apparatus in which in calculating the correlation value of a pair of AF data obtained from a pair of line sensors to obtain the distance from the distance measurement object, whether distance measurement is possible or impossible is appropriately determined when a plurality of minimum values of the correlation value exist, thereby lessening the possibility that it is determined that distance measurement is impossible more than necessary and that erroneous distance measurement occurs.
In order to attain the above-described object, the present invention is directed to a distance measuring apparatus, comprising: an AF data generating device which forms images of light from a distance measurement object on a pair of line sensors comprising a plurality of light-receiving elements and generates a pair of AF data for correlation value calculation according to signals from the plurality of light-receiving elements; an AF data obtaining device which obtains a pair of AF data from a pair of employed sensor ranges for use in distance measurement in the pair of line sensors; a correlation value calculating device which determines a pair of window ranges for obtaining the pair of AF data for use in the correlation value calculation in the pair of employed sensor ranges, and sequentially calculates correlation values while shifting the pair of window ranges to obtain a highest correlation level in the pair of employed sensors; a distance measurement object distance calculating device which determines a shift amount of the pair of window ranges providing the highest correlation level according to the correlation values calculated by the correlation value calculating device and calculates a distance from the distance measurement object according to the shift amount of the pair of window ranges; and an impossible distance measurement determining device which determines a first extremum showing the highest correlation level and a second extremum showing a second highest correlation level, of the correlation values obtained by the correlation value calculating device, determines that distance measurement is impossible if a difference between the detected first and second extrema is smaller than a predetermined first threshold, and changes the first threshold in accordance with magnitude of the first extremum.
Preferably, when the first extremum shows a higher correlation level than a predetermined second threshold, the impossible distance measurement determining device sets the first threshold to a smaller value than when the first extremum shows a lower correlation level than the second threshold.
Preferably, the pair of employed sensors are sensors for the entire measurement area of the pair of line sensors; or the entire measurement area of each of the pair of line sensors is divided into a plurality of subareas, and the pair of employed sensors are sensors for the subareas.
According to the present invention, if the difference between the first extremum and the second extremum of the correlation values calculated by the correlation value calculation in each shift amount in the pair of window ranges set in the employed sensor is smaller than a predetermined value (first threshold), it is determined that distance measurement is impossible, and the predetermined value is changed in accordance with the magnitude of the first extremum, thus making it possible to appropriately determine whether distance measurement is possible or impossible according to the aspect of AF data in which it should be determined that distance measurement is possible even if the difference between the first and second extrema is somewhat small, and the aspect of AF data in which it should be determined that distance measurement is impossible even if the difference between the first and second extrema is somewhat large. Therefore, problems such that it is determined that distance measurement is impossible more than necessary, or erroneous distance measurement occurs can be prevented.
In order to attain the above-described object, the present invention is also directed to a distance measuring apparatus, comprising: an AF data generating device which forms images of light from a distance measurement object on a pair of line sensors comprising a plurality of light-receiving elements and generates a pair of AF data for correlation value calculation according to signals from the plurality of light-receiving elements; an AF data obtaining device which obtains a pair of AF data from a pair of employed sensor ranges for use in distance measurement in the pair of line sensors; a correlation value calculating device which determines a pair of window ranges for obtaining the pair of AF data for use in the correlation value calculation in the pair of employed sensor ranges, and sequentially calculates correlation values while shifting the pair of window ranges to obtain a highest correlation level in the pair of employed sensors; a distance measurement object distance calculating device which determines a shift amount of the pair of window ranges providing the highest correlation level according to the correlation values calculated by the correlation value calculating device and calculates a distance from the distance measurement object according to the shift amount of the pair of window ranges; and an impossible distance measurement determining device which determines that distance measurement is impossible if there exists a correlation value of which correlation level is higher than that of an extremum.
According to the present invention, in the case where an extremum that can be determined to be the highest correlation value exists, but there exists a correlation value of which correlation level is higher than that of the extremum, it can be considered that the distance measurement object is located at a distance shorter than the closest distance at which distance measurement is possible, or something abnormal has occurred, and therefore it is determined that distance measurement is impossible to prevent erroneous distance measurement.
Preferably, the distance measuring apparatus further comprises a short distance warning device which gives a short distance warning when the distance from the distance measurement object calculated from the shift amount of the pair of window ranges providing the correlation value of which correlation level is higher than that of the extremum level is shorter than the distance from the distance measurement object calculated from the shift amount of the window ranges providing extremum showing the highest correlation. In this case, because it can be considered that the distance measurement object is located at a distance shorter than the closest distance at which distance measurement is possible, the short distance warning is given.
Preferably, the pair of employed sensor ranges is sensors in the entire distance measurement area of the pair of line sensors, or sensors of respective divided areas into which the entire distance measurement area of the pair of line sensors is divided. In the latter case, even if distance measurement by one employed sensor is impossible, distance measurement by the other employed sensor may be possible.